Add lexer for Typed and Untyped Plutus Core #579
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Good day,
This PR attempts to add a lexer for Plutus Core, both Typed- and Untyped-. Plutus Core is the language that runs on the Cardano blockchain. Although it is an intermediary language not meant to be seen by users, it does have a concrete syntax and people might want to have syntax highlighting for it sometimes. If you are curious about Plutus Core, the following blog post can serve as a (steep) introduction:
https://blog.hachi.one/post/an-introduction-to-plutus-core/
It is also built on top of Hugo and would enjoy some highlighting with Chroma! This lexer is based on the Plutus Core specification as of April 2021, as provided by the designers of the language:
https://hydra.iohk.io/build/8205579/download/1/plutus-core-specification.pdf
The two languages (Typed- and Untyped-) are extremely similar and I think it makes a lot of sense to have only one lexer for both. Do tell me if that is not the right approach and if I should split it into two lexers.
I hope such a PR is welcome. I also hope I did things properly because that is my first contact with Chroma. (By the way, I discovered it very recently and I love it; thank you very much for this nice piece of software!)
Best,
-- Nicolas “Niols” Jeannerod